<?php
class NewPostForm extends Zend_Form {
    public function __construct($options = null) 
    {
    	$baseurl = new MHDEV_View_Helper_BaseUrl();
    	
        parent::__construct($options);
        
        $this->setName('new_post');
        
        // Title
        $title = new Zend_Form_Element_Text('title');
        $title->setLabel(Zend_Registry::get('lang')->_('form_post_title'));
        $title->setRequired(false);
        $title->setErrorMessages(array(
            0 => Zend_Registry::get('lang')->_('error_form_post_title'),
        ));
        $title->setOrder(0);
        
        // Text
        $text = new Zend_Form_Element_Textarea('text');
		$text->setLabel(Zend_Registry::get('lang')->_('form_post_text'));
		$text->setRequired(true);
		$text->addFilter('StringTrim');
		$text->addValidator('NotEmpty');
		$text->setAttrib('rows','5');
		$text->setAttrib('cols','30');
		$text->setAttrib('class', 'wysiwyg');
		$text->setErrorMessages(array(
            0 => Zend_Registry::get('lang')->_('error_form_post_text'),
        ));
        $text->setOrder(1);
        
        
        // smilies
        $smilies = New Zend_Form_Element_Checkbox('smilies');
        
        // Submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel(Zend_Registry::get('lang')->_('form_save'));
        $submit->setOrder(10);

        $this->addElements(array($text, $smilies, $submit));
    }
}  
?>